package com.topisv.tms.repository.lightShelf;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import com.topisv.tms.entity.lightShelf.LightShelfStockSku;

/**
 * 灯光架上架明细_DAO
 * @author ch
 *
 */
public abstract interface LightShelfStockSkuDao extends PagingAndSortingRepository<LightShelfStockSku, Long>, JpaSpecificationExecutor<LightShelfStockSku>
{

	@Query("select t from LightShelfStockSku t where t.stock.id=?")
	List<LightShelfStockSku> loadByStockId(Long stockId);

	@Query("select t from LightShelfStockSku t where t.lightShelf.id=? and t.upStatus='0' and t.taskCode=? ")
	List<LightShelfStockSku> loadUnSet(Long id,String taskCode);

	@Query("select t from LightShelfStockSku t where t.lightShelf.id=?")
	List<LightShelfStockSku> loadByShelfId(Long id);

	@Query("select t from LightShelfStockSku t where t.taskCode=?1 and upStatus=?2")
	List<LightShelfStockSku> loadByTaskAndUpstatus(String taskCode,String upStatus);

}